<template>
    <div>
        我是父组件
        <h5>接受子组件传递的数据：{{ msg }}</h5>
        <VChild @toParent="getChildData"></VChild>
    </div>
</template>
<script setup>
import { ref } from 'vue';
import VChild from './VChild.vue';
let msg = ref('')
const getChildData = (data)=>{
    console.log(data);
    msg.value = data
}
</script>
<style scoped>

</style>